import { request, post } from "@/utils/request";
import {
  AIData,
  wechatCorpData,
  emailData,
  emailId,
  payData,
  smsData,
  wechatAccountData,
  storeData,
  storeId,
  merchantId,
} from "@/api/modules/system";
import ApiResult from "@/api/base/ApiResult";
//AI外呼配置查询
export const getAIConfig = () => {
  return request("merchant/aiCallConfig/query",{});
};
//AI外呼配置保存
export const saveAIConfig = (data: AIData) => {
  return request("merchant/aiCallConfig/save", data);
};

//企微配置查询
export const getWechatCorpConfig = () => {
  return request("merchant/corpWechatConfig/query",{});
};
//企微配置保存
export const saveWechatCorpConfig = (data: wechatCorpData) => {
  return request("merchant/corpWechatConfig/save", data);
};

//邮箱配置查询
export const getEmailConfig = (data = {}) => {
  return request("merchant/emailConfig/query", data);
};
//邮箱配置保存
export const saveEmailConfig = (data: emailData) => {
  return request("merchant/emailConfig/save", data);
};
//设置默认邮箱
export const saveEmailConfigDefault = (data: emailId) => {
  return request("merchant/emailConfig/setDefault", data);
};
//删除默认邮箱
export const delEmailConfig = (data: emailId) => {
  return request("merchant/emailConfig/delete", data);
};
//支付配置查询
export const getPayConfig = () => {
  return request("merchant/payConfig/query",{});
};
//支付配置保存
export const savePayConfig = (data: payData) => {
  return request("merchant/payConfig/save", data);
};

//短信配置查询
export const getSmsConfig = () => {
  return request("merchant/proprietaryMsgConfig/query",{});
};
//短信配置保存
export const saveSmsConfig = (data: smsData) => {
  return request("merchant/proprietaryMsgConfig/save", data);
};

//短信公众号配置查询
export const getWechatAccountConfig = () => {
  return request("merchant/wechatPublicConfig/query",{});
};
//短信公众号配置保存
export const saveWechatAccountConfig = (data: wechatAccountData) => {
  return request("merchant/wechatPublicConfig/save", data);
};
//获取所有商家信息
export const getStoreInfos: (data: merchantId) => Promise<ApiResult<any>> = (data: merchantId) => {
  return request("mall/admin/product/getStore2", data);
};
//获取商家配置信息
export const storeConfigs = () => {
  return request("merchant/storeConfig/storeConfigs",{});
};
//删除商家配置信息
export const deleteStore = (data: storeId) => {
  return request("merchant/storeConfig/deleteStore", data);
};
//商家配置信息新增或修改
export const saveOrUpdateStore = (data: storeData) => {
  return request("merchant/storeConfig/saveOrUpdateStore", data);
};
